/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.sonrisas.tools.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "reservacita")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reservacita.findAll", query = "SELECT r FROM Reservacita r"),
    @NamedQuery(name = "Reservacita.findByIdReservaCita", query = "SELECT r FROM Reservacita r WHERE r.idReservaCita = :idReservaCita"),
    @NamedQuery(name = "Reservacita.findByIdPersona", query = "SELECT r FROM Reservacita r WHERE r.idPersona = :idPersona"),
    @NamedQuery(name = "Reservacita.findByIdPaciente", query = "SELECT r FROM Reservacita r WHERE r.idPaciente = :idPaciente"),
    @NamedQuery(name = "Reservacita.findByAdelanto", query = "SELECT r FROM Reservacita r WHERE r.adelanto = :adelanto"),
    @NamedQuery(name = "Reservacita.findByFecha", query = "SELECT r FROM Reservacita r WHERE r.fecha = :fecha"),
    @NamedQuery(name = "Reservacita.findByActivoReservarCita", query = "SELECT r FROM Reservacita r WHERE r.activoReservarCita = :activoReservarCita"),
    @NamedQuery(name = "Reservacita.findByIdUsuario", query = "SELECT r FROM Reservacita r WHERE r.idUsuario = :idUsuario"),
    @NamedQuery(name = "Reservacita.findByFechaCreacion", query = "SELECT r FROM Reservacita r WHERE r.fechaCreacion = :fechaCreacion"),
    @NamedQuery(name = "Reservacita.findByFechaModificacion", query = "SELECT r FROM Reservacita r WHERE r.fechaModificacion = :fechaModificacion")})
public class Reservacita implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idReservaCita")
    private Integer idReservaCita;
    @Column(name = "idPersona")
    private Integer idPersona;
    @Column(name = "idPaciente")
    private Integer idPaciente;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "adelanto")
    private BigDecimal adelanto;
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Basic(optional = false)
    @Column(name = "activoReservarCita")
    private boolean activoReservarCita;
    @Basic(optional = false)
    @Column(name = "IdUsuario")
    private int idUsuario;
    @Column(name = "FechaCreacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaCreacion;
    @Column(name = "FechaModificacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaModificacion;
    @JoinColumn(name = "idMotivo", referencedColumnName = "idMotivo")
    @ManyToOne(optional = false)
    private Motivo idMotivo;
    @JoinColumn(name = "Odontologo_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Odontologo odontologoid;

    public Reservacita() {
    }

    public Reservacita(Integer idReservaCita) {
        this.idReservaCita = idReservaCita;
    }

    public Reservacita(Integer idReservaCita, boolean activoReservarCita, int idUsuario) {
        this.idReservaCita = idReservaCita;
        this.activoReservarCita = activoReservarCita;
        this.idUsuario = idUsuario;
    }

    public Integer getIdReservaCita() {
        return idReservaCita;
    }

    public void setIdReservaCita(Integer idReservaCita) {
        this.idReservaCita = idReservaCita;
    }

    public Integer getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(Integer idPersona) {
        this.idPersona = idPersona;
    }

    public Integer getIdPaciente() {
        return idPaciente;
    }

    public void setIdPaciente(Integer idPaciente) {
        this.idPaciente = idPaciente;
    }

    public BigDecimal getAdelanto() {
        return adelanto;
    }

    public void setAdelanto(BigDecimal adelanto) {
        this.adelanto = adelanto;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public boolean getActivoReservarCita() {
        return activoReservarCita;
    }

    public void setActivoReservarCita(boolean activoReservarCita) {
        this.activoReservarCita = activoReservarCita;
    }

    public int getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(int idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Date getFechaCreacion() {
        return fechaCreacion;
    }

    public void setFechaCreacion(Date fechaCreacion) {
        this.fechaCreacion = fechaCreacion;
    }

    public Date getFechaModificacion() {
        return fechaModificacion;
    }

    public void setFechaModificacion(Date fechaModificacion) {
        this.fechaModificacion = fechaModificacion;
    }

    public Motivo getIdMotivo() {
        return idMotivo;
    }

    public void setIdMotivo(Motivo idMotivo) {
        this.idMotivo = idMotivo;
    }

    public Odontologo getOdontologoid() {
        return odontologoid;
    }

    public void setOdontologoid(Odontologo odontologoid) {
        this.odontologoid = odontologoid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReservaCita != null ? idReservaCita.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reservacita)) {
            return false;
        }
        Reservacita other = (Reservacita) object;
        if ((this.idReservaCita == null && other.idReservaCita != null) || (this.idReservaCita != null && !this.idReservaCita.equals(other.idReservaCita))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Reservacita[ idReservaCita=" + idReservaCita + " ]";
    }
    
}
